import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import org.zjj.config.SpringConfig;
import org.zjj.dao.NameDao;
import org.zjj.service.NameService;

@RunWith(SpringJUnit4ClassRunner.class)//加载Spring容器
@ContextConfiguration(classes = {SpringConfig.class})//获取Spring配置信息
public class Spring2 {

    //引入依赖
    @Autowired
    NameService nameService;

    @Test
    public void showNameDetailTest() {
        nameService.showNameDetail();
    }

    @Test
    public void showNameNewDetailTest() {
        nameService.showNameNewDetail();
    }
}
